import 'dart:convert';

/// code : 0
/// data : {"list":[{"age":0,"appearNovel":{"aiGroupId":0,"appearType":"","author":"","cover":"","fromUser":false,"hot":0,"novelId":0,"popImg":"","roleTypeName":"","storyId":0,"title":""},"appearStory":{"aiGroupId":0,"storyId":0},"avatarUrl":"","background":"","belongTo":"","birthday":"","capsules":0,"chattedUsers":0,"constellation":"","constellationLogo":"","coverUrl":"","description":"","hasNovel":false,"hasStory":false,"isLock":false,"nickname":"","role":"","sex":0,"sort":0,"startMsg":"","tags":"","theaters":0,"type":0,"unlockImg":""}],"pageNo":0,"pageSize":0,"pages":0,"total":0}
/// msg : ""
/// serverTime : 0

RolePageData rolePageDataFromJson(String str) =>
    RolePageData.fromJson(json.decode(str));

String rolePageDataToJson(RolePageData data) => json.encode(data.toJson());

class RolePageData {
  RolePageData({
    int? code,
    Data? data,
    String? msg,
    String? serverTime,
  }) {
    _code = code;
    _data = data;
    _msg = msg;
    _serverTime = serverTime;
  }

  RolePageData.fromJson(dynamic json) {
    _code = json['code'];
    _data = json['data'] != null ? Data.fromJson(json['data']) : null;
    _msg = json['msg'];
    _serverTime = json['serverTime'];
  }

  int? _code;
  Data? _data;
  String? _msg;
  String? _serverTime;

  RolePageData copyWith({
    int? code,
    Data? data,
    String? msg,
    String? serverTime,
  }) =>
      RolePageData(
        code: code ?? _code,
        data: data ?? _data,
        msg: msg ?? _msg,
        serverTime: serverTime ?? _serverTime,
      );

  int? get code => _code;

  Data? get data => _data;

  String? get msg => _msg;

  String? get serverTime => _serverTime;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['code'] = _code;
    if (_data != null) {
      map['data'] = _data?.toJson();
    }
    map['msg'] = _msg;
    map['serverTime'] = _serverTime;
    return map;
  }
}

/// list : [{"age":0,"appearNovel":{"aiGroupId":0,"appearType":"","author":"","cover":"","fromUser":false,"hot":0,"novelId":0,"popImg":"","roleTypeName":"","storyId":0,"title":""},"appearStory":{"aiGroupId":0,"storyId":0},"avatarUrl":"","background":"","belongTo":"","birthday":"","capsules":0,"chattedUsers":0,"constellation":"","constellationLogo":"","coverUrl":"","description":"","hasNovel":false,"hasStory":false,"isLock":false,"nickname":"","role":"","sex":0,"sort":0,"startMsg":"","tags":"","theaters":0,"type":0,"unlockImg":""}]
/// pageNo : 0
/// pageSize : 0
/// pages : 0
/// total : 0

Data dataFromJson(String str) => Data.fromJson(json.decode(str));

String dataToJson(Data data) => json.encode(data.toJson());

class Data {
  Data({
    List<RoleData>? list,
    String? pageNo,
    String? pageSize,
    String? pages,
    String? total,
  }) {
    _list = list;
    _pageNo = pageNo;
    _pageSize = pageSize;
    _pages = pages;
    _total = total;
  }

  Data.fromJson(dynamic json) {
    if (json['list'] != null) {
      _list = [];
      json['list'].forEach((v) {
        _list?.add(RoleData.fromJson(v));
      });
    }
    _pageNo = json['pageNo'];
    _pageSize = json['pageSize'];
    _pages = json['pages'];
    _total = json['total'];
  }

  List<RoleData>? _list;
  String? _pageNo;
  String? _pageSize;
  String? _pages;
  String? _total;

  Data copyWith({
    List<RoleData>? list,
    String? pageNo,
    String? pageSize,
    String? pages,
    String? total,
  }) =>
      Data(
        list: list ?? _list,
        pageNo: pageNo ?? _pageNo,
        pageSize: pageSize ?? _pageSize,
        pages: pages ?? _pages,
        total: total ?? _total,
      );

  List<RoleData>? get list => _list;

  String? get pageNo => _pageNo;

  String? get pageSize => _pageSize;

  String? get pages => _pages;

  String? get total => _total;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_list != null) {
      map['list'] = _list?.map((v) => v.toJson()).toList();
    }
    map['pageNo'] = _pageNo;
    map['pageSize'] = _pageSize;
    map['pages'] = _pages;
    map['total'] = _total;
    return map;
  }
}

/// age : 0
/// appearNovel : {"aiGroupId":0,"appearType":"","author":"","cover":"","fromUser":false,"hot":0,"novelId":0,"popImg":"","roleTypeName":"","storyId":0,"title":""}
/// appearStory : {"aiGroupId":0,"storyId":0}
/// avatarUrl : ""
/// background : ""
/// belongTo : ""
/// birthday : ""
/// capsules : 0
/// chattedUsers : 0
/// constellation : ""
/// constellationLogo : ""
/// coverUrl : ""
/// description : ""
/// hasNovel : false
/// hasStory : false
/// isLock : false
/// nickname : ""
/// role : ""
/// sex : 0
/// sort : 0
/// startMsg : ""
/// tags : ""
/// theaters : 0
/// type : 0
/// unlockImg : ""

RoleData listFromJson(String str) => RoleData.fromJson(json.decode(str));

String listToJson(RoleData data) => json.encode(data.toJson());

class RoleData {
  RoleData({
    int? age,
    AppearNovel? appearNovel,
    AppearStory? appearStory,
    String? avatarUrl,
    String? background,
    String? belongTo,
    String? birthday,
    int? capsules,
    int? chattedUsers,
    String? constellation,
    String? constellationLogo,
    String? coverUrl,
    String? description,
    bool? hasNovel,
    bool? hasStory,
    bool? isLock,
    String? nickname,
    String? role,
    int? sex,
    int? sort,
    String? startMsg,
    String? tags,
    int? theaters,
    int? type,
    String? unlockImg,
  }) {
    _age = age;
    _appearNovel = appearNovel;
    _appearStory = appearStory;
    _avatarUrl = avatarUrl;
    _background = background;
    _belongTo = belongTo;
    _birthday = birthday;
    _capsules = capsules;
    _chattedUsers = chattedUsers;
    _constellation = constellation;
    _constellationLogo = constellationLogo;
    _coverUrl = coverUrl;
    _description = description;
    _hasNovel = hasNovel;
    _hasStory = hasStory;
    _isLock = isLock;
    _nickname = nickname;
    _role = role;
    _sex = sex;
    _sort = sort;
    _startMsg = startMsg;
    _tags = tags;
    _theaters = theaters;
    _type = type;
    _unlockImg = unlockImg;
  }

  RoleData.fromJson(dynamic json) {
    _age = json['age'];
    _appearNovel = json['appearNovel'] != null
        ? AppearNovel.fromJson(json['appearNovel'])
        : null;
    _appearStory = json['appearStory'] != null
        ? AppearStory.fromJson(json['appearStory'])
        : null;
    _avatarUrl = json['avatarUrl'];
    _background = json['background'];
    _belongTo = json['belongTo'];
    _birthday = json['birthday'];
    _capsules = json['capsules'];
    _chattedUsers = json['chattedUsers'];
    _constellation = json['constellation'];
    _constellationLogo = json['constellationLogo'];
    _coverUrl = json['coverUrl'];
    _description = json['description'];
    _hasNovel = json['hasNovel'];
    _hasStory = json['hasStory'];
    _isLock = json['isLock'];
    _nickname = json['nickname'];
    _role = json['role'];
    _sex = json['sex'];
    _sort = json['sort'];
    _startMsg = json['startMsg'];
    _tags = json['tags'];
    _theaters = json['theaters'];
    _type = json['type'];
    _unlockImg = json['unlockImg'];
  }

  int? _age;
  AppearNovel? _appearNovel;
  AppearStory? _appearStory;
  String? _avatarUrl;
  String? _background;
  String? _belongTo;
  String? _birthday;
  int? _capsules;
  int? _chattedUsers;
  String? _constellation;
  String? _constellationLogo;
  String? _coverUrl;
  String? _description;
  bool? _hasNovel;
  bool? _hasStory;
  bool? _isLock;
  String? _nickname;
  String? _role;
  int? _sex;
  int? _sort;
  String? _startMsg;
  String? _tags;
  int? _theaters;
  int? _type;
  String? _unlockImg;

  RoleData copyWith({
    int? age,
    AppearNovel? appearNovel,
    AppearStory? appearStory,
    String? avatarUrl,
    String? background,
    String? belongTo,
    String? birthday,
    int? capsules,
    int? chattedUsers,
    String? constellation,
    String? constellationLogo,
    String? coverUrl,
    String? description,
    bool? hasNovel,
    bool? hasStory,
    bool? isLock,
    String? nickname,
    String? role,
    int? sex,
    int? sort,
    String? startMsg,
    String? tags,
    int? theaters,
    int? type,
    String? unlockImg,
  }) =>
      RoleData(
        age: age ?? _age,
        appearNovel: appearNovel ?? _appearNovel,
        appearStory: appearStory ?? _appearStory,
        avatarUrl: avatarUrl ?? _avatarUrl,
        background: background ?? _background,
        belongTo: belongTo ?? _belongTo,
        birthday: birthday ?? _birthday,
        capsules: capsules ?? _capsules,
        chattedUsers: chattedUsers ?? _chattedUsers,
        constellation: constellation ?? _constellation,
        constellationLogo: constellationLogo ?? _constellationLogo,
        coverUrl: coverUrl ?? _coverUrl,
        description: description ?? _description,
        hasNovel: hasNovel ?? _hasNovel,
        hasStory: hasStory ?? _hasStory,
        isLock: isLock ?? _isLock,
        nickname: nickname ?? _nickname,
        role: role ?? _role,
        sex: sex ?? _sex,
        sort: sort ?? _sort,
        startMsg: startMsg ?? _startMsg,
        tags: tags ?? _tags,
        theaters: theaters ?? _theaters,
        type: type ?? _type,
        unlockImg: unlockImg ?? _unlockImg,
      );

  int? get age => _age;

  AppearNovel? get appearNovel => _appearNovel;

  AppearStory? get appearStory => _appearStory;

  String? get avatarUrl => _avatarUrl;

  String? get background => _background;

  String? get belongTo => _belongTo;

  String? get birthday => _birthday;

  int? get capsules => _capsules;

  int? get chattedUsers => _chattedUsers;

  String? get constellation => _constellation;

  String? get constellationLogo => _constellationLogo;

  String? get coverUrl => _coverUrl;

  String? get description => _description;

  bool? get hasNovel => _hasNovel;

  bool? get hasStory => _hasStory;

  bool? get isLock => _isLock;

  String? get nickname => _nickname;

  String? get role => _role;

  int? get sex => _sex;

  int? get sort => _sort;

  String? get startMsg => _startMsg;

  String? get tags => _tags;

  int? get theaters => _theaters;

  int? get type => _type;

  String? get unlockImg => _unlockImg;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['age'] = _age;
    if (_appearNovel != null) {
      map['appearNovel'] = _appearNovel?.toJson();
    }
    if (_appearStory != null) {
      map['appearStory'] = _appearStory?.toJson();
    }
    map['avatarUrl'] = _avatarUrl;
    map['background'] = _background;
    map['belongTo'] = _belongTo;
    map['birthday'] = _birthday;
    map['capsules'] = _capsules;
    map['chattedUsers'] = _chattedUsers;
    map['constellation'] = _constellation;
    map['constellationLogo'] = _constellationLogo;
    map['coverUrl'] = _coverUrl;
    map['description'] = _description;
    map['hasNovel'] = _hasNovel;
    map['hasStory'] = _hasStory;
    map['isLock'] = _isLock;
    map['nickname'] = _nickname;
    map['role'] = _role;
    map['sex'] = _sex;
    map['sort'] = _sort;
    map['startMsg'] = _startMsg;
    map['tags'] = _tags;
    map['theaters'] = _theaters;
    map['type'] = _type;
    map['unlockImg'] = _unlockImg;
    return map;
  }
}

/// aiGroupId : 0
/// storyId : 0

AppearStory appearStoryFromJson(String str) =>
    AppearStory.fromJson(json.decode(str));

String appearStoryToJson(AppearStory data) => json.encode(data.toJson());

class AppearStory {
  AppearStory({
    String? aiGroupId,
    String? storyId,
  }) {
    _aiGroupId = aiGroupId;
    _storyId = storyId;
  }

  AppearStory.fromJson(dynamic json) {
    _aiGroupId = json['aiGroupId'];
    _storyId = json['storyId'];
  }

  String? _aiGroupId;
  String? _storyId;

  AppearStory copyWith({
    String? aiGroupId,
    String? storyId,
  }) =>
      AppearStory(
        aiGroupId: aiGroupId ?? _aiGroupId,
        storyId: storyId ?? _storyId,
      );

  String? get aiGroupId => _aiGroupId;

  String? get storyId => _storyId;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['aiGroupId'] = _aiGroupId;
    map['storyId'] = _storyId;
    return map;
  }
}

/// aiGroupId : 0
/// appearType : ""
/// author : ""
/// cover : ""
/// fromUser : false
/// hot : 0
/// novelId : 0
/// popImg : ""
/// roleTypeName : ""
/// storyId : 0
/// title : ""

AppearNovel appearNovelFromJson(String str) =>
    AppearNovel.fromJson(json.decode(str));

String appearNovelToJson(AppearNovel data) => json.encode(data.toJson());

class AppearNovel {
  AppearNovel({
    String? aiGroupId,
    String? appearType,
    String? author,
    String? cover,
    bool? fromUser,
    int? hot,
    String? novelId,
    String? popImg,
    String? roleTypeName,
    String? storyId,
    String? title,
  }) {
    _aiGroupId = aiGroupId;
    _appearType = appearType;
    _author = author;
    _cover = cover;
    _fromUser = fromUser;
    _hot = hot;
    _novelId = novelId;
    _popImg = popImg;
    _roleTypeName = roleTypeName;
    _storyId = storyId;
    _title = title;
  }

  AppearNovel.fromJson(dynamic json) {
    _aiGroupId = json['aiGroupId'];
    _appearType = json['appearType'];
    _author = json['author'];
    _cover = json['cover'];
    _fromUser = json['fromUser'];
    _hot = json['hot'];
    _novelId = json['novelId'];
    _popImg = json['popImg'];
    _roleTypeName = json['roleTypeName'];
    _storyId = json['storyId'];
    _title = json['title'];
  }

  String? _aiGroupId;
  String? _appearType;
  String? _author;
  String? _cover;
  bool? _fromUser;
  int? _hot;
  String? _novelId;
  String? _popImg;
  String? _roleTypeName;
  String? _storyId;
  String? _title;

  AppearNovel copyWith({
    String? aiGroupId,
    String? appearType,
    String? author,
    String? cover,
    bool? fromUser,
    int? hot,
    String? novelId,
    String? popImg,
    String? roleTypeName,
    String? storyId,
    String? title,
  }) =>
      AppearNovel(
        aiGroupId: aiGroupId ?? _aiGroupId,
        appearType: appearType ?? _appearType,
        author: author ?? _author,
        cover: cover ?? _cover,
        fromUser: fromUser ?? _fromUser,
        hot: hot ?? _hot,
        novelId: novelId ?? _novelId,
        popImg: popImg ?? _popImg,
        roleTypeName: roleTypeName ?? _roleTypeName,
        storyId: storyId ?? _storyId,
        title: title ?? _title,
      );

  String? get aiGroupId => _aiGroupId;

  String? get appearType => _appearType;

  String? get author => _author;

  String? get cover => _cover;

  bool? get fromUser => _fromUser;

  int? get hot => _hot;

  String? get novelId => _novelId;

  String? get popImg => _popImg;

  String? get roleTypeName => _roleTypeName;

  String? get storyId => _storyId;

  String? get title => _title;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['aiGroupId'] = _aiGroupId;
    map['appearType'] = _appearType;
    map['author'] = _author;
    map['cover'] = _cover;
    map['fromUser'] = _fromUser;
    map['hot'] = _hot;
    map['novelId'] = _novelId;
    map['popImg'] = _popImg;
    map['roleTypeName'] = _roleTypeName;
    map['storyId'] = _storyId;
    map['title'] = _title;
    return map;
  }
}
